package net.csdn.business.notify.handler.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import net.csdn.business.notify.common.mapper.NotifyCallLogMapper;
import net.csdn.business.notify.common.model.dto.NewNotifyCallLogDTO;
import net.csdn.business.notify.common.model.dto.UpdateNotifyCallLogDTO;
import net.csdn.business.notify.common.model.entity.NotifyCallLog;
import net.csdn.business.notify.common.model.query.NotifyCallLogQuery;
import net.csdn.business.notify.common.model.vo.NotifyCallLogVO;
import net.csdn.business.notify.handler.service.INotifyCallLogService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import java.util.List;



/**
 * 通知中心-接口调用记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-11-27
 */
@Service
public class NotifyCallLogServiceImpl extends ServiceImpl<NotifyCallLogMapper, NotifyCallLog> implements INotifyCallLogService
{

    /**
     * 分页查询通知中心-接口调用记录列表
     *
     * @param query 通知中心-接口调用记录
     * @return 通知中心-接口调用记录
     */
    @Override
    public Page<NotifyCallLogVO> findPageList(NotifyCallLogQuery query) {
        //获得Page对象
        Page<NotifyCallLogVO> page = query.getPage();
        List<NotifyCallLogVO> pageList=baseMapper.findPageList(page,query);
        page.setRecords(pageList);
        return page;
    }

    /**
     * 根据id查询通知中心-接口调用记录
     * 
     * @param id 通知中心-接口调用记录主键
     * @return 通知中心-接口调用记录
     */
    @Override
    public NotifyCallLogVO selectNotifyCallLogById(String id)
    {
        return baseMapper.selectNotifyCallLogById(id);
    }

    /**
     * 查询通知中心-接口调用记录列表
     * 
     * @param query 通知中心-接口调用记录
     * @return 通知中心-接口调用记录
     */
    @Override
    public List<NotifyCallLogVO> selectNotifyCallLogList(NotifyCallLogQuery query)
    {
        return baseMapper.selectNotifyCallLogList(query);
    }

    /**
     * 新增通知中心-接口调用记录
     *
     * @param newNotifyCallLogDTO 通知中心-接口调用记录
     * @return 结果
     */
    @Override
    public Integer insertNotifyCallLog(NewNotifyCallLogDTO newNotifyCallLogDTO)
    {
        NotifyCallLog notifyCallLog=new NotifyCallLog();
        BeanUtils.copyProperties(newNotifyCallLogDTO,notifyCallLog);
        return baseMapper.insertNotifyCallLog(notifyCallLog);
    }

    /**
     * 修改通知中心-接口调用记录
     *
     * @param updateNotifyCallLogDTO 通知中心-接口调用记录
     * @return 结果
     */
    @Override
    public Integer updateNotifyCallLog(UpdateNotifyCallLogDTO updateNotifyCallLogDTO)
    {
        NotifyCallLog notifyCallLog=new NotifyCallLog();
        BeanUtils.copyProperties(updateNotifyCallLogDTO,notifyCallLog);
        return baseMapper.updateNotifyCallLog(notifyCallLog);
    }

    /**
     * 删除通知中心-接口调用记录信息
     * 
     * @param id 通知中心-接口调用记录主键
     * @return 结果
     */
    @Override
    public Integer deleteNotifyCallLogById(String id)
    {
        return baseMapper.deleteNotifyCallLogById(id);
    }
}
